<!DOCTYPE html>
<html lang="en">
	<head>
		<title>${appName}</title>
		<style type="text/css">
			body {margin: 0px auto;}
			.login_logo {width:1000px;height:100px;margin:0px auto;}
			.login_main {width:100%;min-width:1000px;background: url(../assets/images/app/dly_main_bg.jpg) no-repeat top center #2e71c2;height:469px;}
			.login_main_br {padding-top:80px;}
			.login_main_login {}
			.login_main_login td{height:30px;line-height:30px;padding:8px 0px;}
			.login_main_login td input{border:1px solid #b8daff;height:30px;line-height:30px;padding-left:5px;color:#a1a7c1;font-size:14px;}
		</style>
	</head>

	<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.getElementById('userName').focus();">
	<div class="login_logo"><img src="../assets/images/app/dly_logo.jpg" width="638"  /></div>
	<div class="login_main">
		<form action="<%=basePath%>manage.do" method="post" id="form4">
			<input type="hidden" id="userid" name="userid" value="" />
		</form>
		<form action="<%=basePath%>system/changepwd.do" method="post" id="firsrname"></form>
		<form action="login.do" method="post" id="login" name="login">
			<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="login_main_br">
				<tr>
					<td width="550">&nbsp;</td>
					<td width="250"><table width="250" border="0" cellspacing="0" cellpadding="0" align="center" class="login_main_login">
							<tr>
								<td><img src="../assets/images/app/dly_main_title.jpg" width="50" height="25" /></td>
								<td></td>
							</tr>
							<tr>
								<td width="70">用户名：</td>
								<td>
									<input name="usercode" type="text" id="userName" style="width:160px;"  onkeypress="if(event.keyCode==13) {document.getElementById('passWord').focus();}"/></td>
							</tr>
							<tr>
								<td width="70">密&nbsp;&nbsp;&nbsp;码：</td>
								<td><input name="userpwd" type="password" id="passWord" style="width:160px;" onkeypress="if(event.keyCode==13) {document.getElementById('veryCode').focus()}"/></td>
							</tr>
							<tr>
								<#if captcha == 'off'>
									<td height="50" colspan="2">&nbsp;</td>
								<#else>
								<td width="70">验证码：</td>
								<td><input name="viery" type="text" id="veryCode"  maxlength="4" style="width:70px;" onkeypress="if(event.keyCode==13) {javascript:denglu();}"/>&nbsp;&nbsp;<img id="imgObj" onclick="changeImg();" title="看不清？单击此处刷新" alt="验证码" style="vertical-align:middle;height: 32px;" /></td>
								</#if>
							</tr>
						</table>
						<table width="250" border="0" cellspacing="0" cellpadding="0" height="70">
							<tr>
								<td align="center"><img src="../assets/images/app/dly_main_login.jpg" width="110" height="33" id="loginbtn4" onclick="denglu();" /> <img src="../assets/images/app/dly_main_cancle.jpg" width="110" height="33" /></td>
							</tr>
						</table>

					</td>
				</tr>
			</table>
		</form>
	</div>
	<!--[if !IE]> -->
	<script src="../assets/js/jquery-2.1.4.min.js"></script>
	<!-- <![endif]-->

	<!--[if IE]>
	<script src="../assets/js/jquery-1.11.3.min.js"></script>
	<![endif]-->
	<script type="text/javascript">
		if (window != top) top.location.href = location.href;

		$(function ($) {
			changeImg();
		})

		function denglu() {
			var usercode = $("#userName").val();
			var pwd = $("#passWord").val();
			var yzm = '';
			if (usercode == '') {
				alert('请填写用户名');
				return;
			}
			if (pwd == '') {
				alert('请填写登录密码');
				return;
			}
			<#if captcha != 'off'>
			var yzm = $("#veryCode").val();
			if (yzm == '') {
				alert('请填写验证码');
				return;
			}
			</#if>

			$.ajax({
				url:"../login",
				type: 'POST',
				data: {userCode: usercode, userPwd: pwd, viery: yzm},
				dataType: 'json',
				success:function(data){
					if(data.success) {
						window.location = '../index';
					}else {
						alert(data.msg);
						changeImg();
					}
				}
			});
		}
		function changeImg(){
			$("#imgObj").attr("src", "../captcha/captchaImage?" + Date.now());
		}
	</script>
	</body>
</html>
